import 'package:dk_flutter_base/src/ui/ui_model/select_model.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_app_bar.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_bottom_dialog.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_bottom_sheet_dialog.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_center_dialog.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_widget_container.dart';
import 'package:dk_flutter_base/src/ui/widget/tip_dialog_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'package:dk_flutter_base/src/ui/widget/trans_select_bottom.dart';

class Person with SelectModel {
  String title;
  String content;

  Person(this.title, this.content) {
    initSelectModel(title, content);
  }
}

class TestTipDialogWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return TipDialogSate();
  }
}

class TipDialogSate extends State<TestTipDialogWidget> {
  final List<Person> list = List();

  @override
  void initState() {
    super.initState();
    for (int i = 0; i < 3; i++) {
      list.add(Person('标题$i', '内容$i'));
    }
  }

  String btn = "底部弹窗";
  final TransSelectBottomOption transSelectBottomOption =
      TransSelectBottomOption();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.0,
        title: Text('弹窗'),
      ),
      body: Container(
        color: Colors.red,
        height: double.infinity,
        child: InkWell(
          child: Text(btn),
          onTap: () {
            DkCenterDialog.create(
                CenterDialogOption((BuildContext context) {
              return TipDialogWidget(
                  TipDialogOption.normalWithContent("haha "));
            }, handleResult: (bool result) {
              btn = result.toString();
            })).show(context);
          },
        ),
      ),
    );
  }

/*void showSheet(BuildContext context, Widget listView) {
    showBottomSheet(
      context: context,
      builder: (BuildContext context) {
        return Container(
          child: listView,
          height: 300,
        );
      },
    );
  }

  void showSheetPage(BuildContext context, ListView listView) {
    showModalBottomSheet(
        context: context,
        builder: (BuildContext context) {
          Container(
            child: listView,
            height: 300,
          );
        });
  }*/
}
